package com.hoshiicloud.as2c.minipro.feign;

import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.as2c.minipro.feign.hystrix.HystrixVeriCenterFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author yangcheng
 * @version 1.0
 * @title: veriCenterFeignService
 * @description: 验证中心微服务FeignClient
 * @date 2019/5/30 17:59
 * @mail maiboyc@163.com
 */
@FeignClient(name = "hoshiicloud-common-vericenter", fallback = HystrixVeriCenterFeignFallback.class)
public interface VeriCenterFeignService {

    /**
     * 发送短信验证码
     * @param mobile        手机号码
     * @param code          验证码
     * @param expSecond     有效时间(单位:秒)
     * @return Response<SmsMsgResponse>
     */
    @RequestMapping(value = "/sms/sendCode", method = RequestMethod.POST)
    Response<String> sendCode(@RequestParam("mobile") String mobile, @RequestParam("code") String code, @RequestParam("expSecond") long expSecond);

    /**
     * 校验验证码
     * @param msgId 短信ID
     * @param code  验证码
     * @return Response
     */
    @RequestMapping(value = "/sms/check", method = RequestMethod.POST)
    Response checkCode(@RequestParam("msgId") String msgId, @RequestParam("code") String code);

}
